﻿function showRoomContextMenu(e, roomStatus, selectedId, queryString) {             
    var contextMenu = getContextMenu(roomStatus);
    
    if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
         $(".room_radio_selectedItem input").attr('checked', false);
         $("#" + selectedId).attr('checked', true);
        contextMenu.secParams = queryString; 
        contextMenu.show(e);
    }
    $telerik.cancelRawEvent(e);
}
function showFloorContextMenu(e, queryString) {
    var contextMenu = getFloorContextMenu();
    if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {    
        contextMenu.secParams = queryString; 
        contextMenu.show(e);
    }
    $telerik.cancelRawEvent(e);
}

/*  Mode=1: Single, 2:Multi */
function selectRoom(mode, selectorID, sender) {
    var selector = document.getElementById(selectorID);
  
    if(selector != null){
        selector.click();
    }
}
function resetAllRadio(sender){           
    $(".room_radio_selector input").attr('checked', false);
    $(".roomSelected").removeClass('roomSelected');
    
    sender.checked = true;
    var divId = sender.id.replace("_uxSelectOne", "_uxRoomInfo");
    $("#" + divId).addClass("roomSelected");
    return true;
}
function resetCheckBox(sender){
    var divId = sender.id.replace("_uxSelectMulti", "_uxRoomInfo");
    if(sender.checked)
        $("#" + divId).addClass("roomSelected");
    else 
         $("#" + divId).removeClass("roomSelected");
    return true;
}